import { managementService } from '~/config/server'
import { NetService } from '~/utils/net.service';
import { Inject, Debounce } from '~/core/decorator';
import { Service } from '~/core/service';

export class CodePrarmeterService extends Service {
  @Inject(NetService)
  private netService: NetService;

  /**
   * 新增参数代码字典
   */
  @Debounce()
  public addCodeConfig (data) {
    return this.netService.send({
      server: managementService.codeRarameterController.addCodeConfigInfo,
      data,
    });
  }
  /**
   * 编辑代码参数字典
   */
  @Debounce()
  public updateCodeConfig (data) {
    return this.netService.send({
      server: managementService.codeRarameterController.updateCodeConfigInfo,
      data,
    });
  }
  /**
   * 新增地区码
   */
  @Debounce()
  public addRegional (data) {
    return this.netService.send({
      server: managementService.codeRarameterController.addRegionalConfig,
      data,
    });
  }

  /**
   * 删除代码参数配置
   */
  @Debounce()
  public deleteCode (data) {
    return this.netService.send({
      server: managementService.codeRarameterController.deleteCode,
      data
    });
  }

  /**
   * 根据条件查询地区配置信息
   */
  @Debounce()
  public getAllAreaConfig (data, page) {
    return this.netService.send({
      server: managementService.codeRarameterController.getAllAreaConfig,
      data,
      page,
    });
  }

  /**
   * 查询所有代码参数字典
   */
  @Debounce()
  public getAllCode () {
    return this.netService.send({
      server: managementService.codeRarameterController.getAllCode,
    });
  }

  /**
   * 根据条件查询所有用户
   */
  @Debounce()
  public getAllUsers (data, page) {
    return this.netService.send({
      server: managementService.codeRarameterController.getAllUsers,
      data,
      page
    });
  }

  /**
   * 查询所有用户
   */
  @Debounce()
  public getAllUsersList (data, page) {
    return this.netService.send({
      server: managementService.codeRarameterController.getAllUsersList,
      data,
      page
    });
  }
  /**
   * 地区码配置详情
   */
  @Debounce()
  public getRegionalConfig (data) {
    return this.netService.send({
      server: managementService.codeRarameterController.getRegionalConfig,
      data
    });
  }
  /**
   * 编辑地区码
   */
  @Debounce()
  public updateCodeConfigInfo (data) {
    return this.netService.send({
      server: managementService.codeRarameterController.updateCodeConfigInfo,
      data
    });
  }
  /**
   * 获取执行页手动标识下拉
   */
  @Debounce()
  public getAllHandWorkCode () {
    return this.netService.send({
      server: managementService.codeRarameterController.getAllHandWorkCode
    });
  }
}
